Xbasic

SQL::RowDataIsNull Method

Syntax

Result_Flag as L = DataIsNull(ColumnIndex as N | ColumnName as C)

Arguments

Result_Flag

Indicates whether the data is NULL.

SQL::Row

A SQL::Row object created with a DIM statement.

ColumnIndex

The index of the column containing the data.

Description

Determine whether a given element is Null.

Discussion

The DataIsNull() method determines whether a given element is NULL.

Example

dim conn as SQL::Connection
dim rs as SQL::ResultSet
dim row as SQL::Row
dim connString as C
dim select_exp as C
dim list as C
connString = "{A5API='Access', FileName='c:\program files\a5v8\mdbfiles\alphasports.mdb'}"
select_exp = "select * from customer where bill_state_region = 'ny'"
if .not. conn.open(connString)
ui_msg_box("Error", conn.CallResult.text)
end
end if
if .not. conn.execute(select_exp)
ui_msg_box("Error", conn.CallResult.text)
conn.close()
end
end if
rs = conn.ResultSet
while rs.NextRow()
row = rs.CurrentRow
if .not. row.DataIsNull(5) then
list = list + row.Data(5) + crlf()
end if
end while
ui_msg_box("Phone Numbers", list)
conn.close()

See Also